{extend name="base" /}
{block name="body"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <form action="{:request()->url()}" class="layui-form layui-form-pane" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">上级菜单</label>
                <div class="layui-input-block">
                    <select name="pid" lay-search>
                        <option value="0">主菜单</option>
                        {volist name="list" id="v" empty="$empty"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.pid eq $v.id"}selected{/if}{if input('pid')==$v.id}selected{/if}>{neq name="v.level" value="1"}|{php}for($i=1;$i<$v['level'];$i++){echo ' ---';}{/php}{/neq} {$v.name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入名称" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">控制器</label>
                <div class="layui-input-block">
                    <input type="text" name="url" value="{$data.url|default=''}" autocomplete="off" placeholder="admin/index/index" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">图标</label>
                <div class="layui-input-block">
                    <input type="text" name="icon" value="{$data.icon|default=''}" autocomplete="off" placeholder="layui-icon" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" pane>
                <label class="layui-form-label">菜单显示？</label>
                <div class="layui-input-block">
                    <input type="radio" name="type" value="nav" title="是" {if empty($data) or isset($data) and $data.type eq 'nav'}checked="checked"{/if}>
                    <input type="radio" name="type" value="auth" title="否" {if isset($data) and $data.type eq 'auth'}checked="checked"{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-block">
                    <input type="text" name="sort_order" value="{$data.sort_order|default='0'}" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" value="{$data.id|default=''}">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
